import App from './App'
// 引入 uView UI
import uView from './uni_modules/vk-uview-ui';
import store from './store';
import * as utils from "./common/js/utils";

import config from './common/js/config'; 
import httpInterceptor from "./common/js/http.interceptor";
import httpApi from "./common/js/http.api";

// #ifdef VUE2

import Vue from 'vue'

// 使用 uView UI
Vue.use(uView);

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()

// #endif



// #ifdef VUE3

import { createSSRApp } from 'vue'
import Vuex from "vuex";
export function createApp() {
	const app = createSSRApp(App)
	
	// 全局挂载
	app.config.globalProperties.$util = utils;

	app.config.globalProperties.baseUrl = config.baseUrl;
	app.config.globalProperties.baseImgUrl = config.baseImgUrl;
	app.config.globalProperties.defaultAvatar = config.defaultAvatar;

	// 使用 uView UI
	app.use(uView)
	app.use(store)
	app.use(httpInterceptor)
	app.use(httpApi)
	// httpInterceptor.install(app)

	
	return {
		app
	}
}

// #endif